/**
 * Mixin DOMUtils
 *
 * Loads javascript and stylesheets dynamically by adding them to the page head
 * 
 * @author David Lindkvist (david.lindkvist@shapeshift.se)
 */

PWF.mixin.DOMUtils = {

	loadStyleSheet: function(src)
	{
		var css = new Element('link', {'rel': 'stylesheet', 'href': src, 'type': 'text/css', 'media': 'all'});
		document.getElementsByTagName('head')[0].appendChild(css);
	},
	loadJavaScript: function(src)
	{
		//create link element and add to document head
		var script = new Element('script', {'src': src, 'type': 'text/javascript'});
		document.getElementsByTagName('head')[0].appendChild(script);
	}
};